$(function() {
	set_iframe_height($(window).height())
	read_txt()

})

function set_iframe_height(height) {
	$("#novel_txt").on("load", function() {
		$(this).height(height * 25)
	})
}

function read_txt() {
	$("[txt]").click(function() {
		txt_url = $(this).attr("txt");
		console.log(txt_url)
		$("#novel_txt").attr("src", txt_url)
	})
}

function reading(fId, reading) {
	console.log('fId:' + fId)
	console.log('reading:' + reading)
	$.post("http://193.112.72.237/Web-comfun/web/index.php?r=fiction/index", {
		'function': "Reading",
		'fId': fId,
		'reading': reading,
		'session': $.cookie("session")
	}, function(data) {})
}
